package LOGISTICS;


import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;

public class test005_js {

	public static void main(String[] args) throws ScriptException {
		ScriptEngineManager manager = new ScriptEngineManager();
        ScriptEngine se = manager.getEngineByName("js");
        
        se.put("content", "2000.00");
        
//        se.put("a", 1);
//        se.put("b", 5);

//        Bindings bindings = se.getBindings(ScriptContext.ENGINE_SCOPE);
//        Object a = bindings.get("a");
//        Object b = bindings.get("b");
//        System.out.println("a = " + a);
//        System.out.println("b = " + b);
//
//        Object result = se.eval("c = a + b;");
//        System.out.println("a + b = " + result);
        
        String str = "content.split(\".\")[0]";
        String result =(String) se.eval(str);
        System.out.println(result);
	}

}
